#include "gtkwidget.h"
#include "gtkwidgetprivate.h"
+#include "gtkdebug.h"
#include <string.h>
GVariant *state,
gboolean should_emit_signals)
{
+ GTK_NOTE(ACTIONS, g_message("actionhelper: %s added", helper->action_name));
+
/* we can only activate if we have the correct type of parameter */
helper->can_activate = (helper->target == NULL && parameter_type == NULL) ||
(helper->target != NULL && parameter_type != NULL &&
g_variant_is_of_type (helper->target, parameter_type));
if (!helper->can_activate)
- return;
+ {
+ GTK_NOTE(ACTIONS, g_message("actionhelper: %s found, but disabled due to parameter type mismatch",
+ helper->action_name));
+ return;
+ }
+
+ GTK_NOTE(ACTIONS, g_message ("actionhelper: %s can be activated", helper->action_name));
helper->enabled = enabled;
+ if (!enabled)
+ GTK_NOTE(ACTIONS, g_message("actionhelper: %s found, but disabled due to disabled action", helper->action_name));
+ else
+ GTK_NOTE(ACTIONS, g_message("actionhelper: %s found and enabled", helper->action_name));
+
if (helper->target != NULL && state != NULL)
helper->active = g_variant_equal (state, helper->target);
static void
gtk_action_helper_action_removed (GtkActionHelper *helper)
{
+ GTK_NOTE(ACTIONS, g_message ("actionhelper: %s was removed", helper->action_name));
+
if (!helper->can_activate)
return;
gtk_action_helper_action_enabled_changed (GtkActionHelper *helper,
gboolean enabled)
{
+ GTK_NOTE(ACTIONS, g_message ("actionhelper: %s enabled changed: %d", helper->action_name, enabled));
+
if (!helper->can_activate)
return;
{
gboolean was_active;
+ GTK_NOTE(ACTIONS, g_message ("actionhelper: %s state changed", helper->action_name));
+
if (!helper->can_activate)
return;
if (g_strcmp0 (action_name, helper->action_name) == 0)
return;
+ GTK_NOTE(ACTIONS,
+ if (!strchr (action_name, '.'))
+ g_message ("actionhelper: action name %s doesn't look like 'app.' or 'win.' "
+ "which means that it will probably not work properly.", action_name));
+
if (helper->action_name)
{
gtk_action_observable_unregister_observer (GTK_ACTION_OBSERVABLE (helper->action_context),
if (g_action_group_query_action (G_ACTION_GROUP (helper->action_context), helper->action_name,
&enabled, ¶meter_type, NULL, NULL, &state))
{
+ GTK_NOTE(ACTIONS, g_message ("actionhelper: %s existed from the start", helper->action_name));
+
gtk_action_helper_action_added (helper, enabled, parameter_type, state, FALSE);
if (state)
g_variant_unref (state);
}
else
- helper->enabled = FALSE;
+ {
+ GTK_NOTE(ACTIONS, g_message ("actionhelper: %s missing from the start", helper->action_name));
+ helper->enabled = FALSE;
+ }
/* Send the notifies for the properties that changed.
*
{"pixel-cache", GTK_DEBUG_PIXEL_CACHE},
{"no-pixel-cache", GTK_DEBUG_NO_PIXEL_CACHE},
{"interactive", GTK_DEBUG_INTERACTIVE},
- {"touchscreen", GTK_DEBUG_TOUCHSCREEN}
+ {"touchscreen", GTK_DEBUG_TOUCHSCREEN},
+ {"actions", GTK_DEBUG_ACTIONS},
};
#endif /* G_ENABLE_DEBUG */